package com.vsu.bookstore.mvc.ui.widgetcontainers;

import com.vaadin.ui.Component;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
import com.vsu.bookstore.mvc.ui.AbstractView;

public class MainPanel extends AbstractView
{
  private static final long serialVersionUID = 1L;

  private final Panel panel = new Panel();

  public MainPanel()
  {
    setSizeFull();
    final VerticalLayout layout = (VerticalLayout)panel.getContent();
    layout.setMargin(false, true, false, false);
    panel.addStyleName("light");
    panel.setCaption("Great Book Store");
    panel.setSizeFull();
    setCompositionRoot(panel);
  }

  @Override
  protected void onView()
  {
  }

  void setMainView(final Component mainView)
  {
    panel.removeAllComponents();
    panel.addComponent(mainView);
  }
}
